<?php
namespace app\admin\controller;

use app\common\controller\Backend;
/**
 * Created by PhpStorm.
 * User: 王飞
 * Date: 2017/9/2
 * Time: 16:54
 */
class Picwall extends Backend
{
	
	protected $model = null;
	
	public function _initialize()
	{
		parent::_initialize();
		$this->model = model('Picwall');
	}
	
	/**
	 * 查看
	 */
	public function index()
	{
		if ($this->request->isAjax())
		{
			list($where, $sort, $order, $offset, $limit) = $this->buildparams();
			$total = $this->model
				->where($where)
				->order($sort, $order)
				->count();
			$list = $this->model
				->where($where)
				->order($sort, $order)
				->limit($offset, $limit)
				->select();
			$result = array("total" => $total, "rows" => $list);
			
			return json($result);
		}
		return $this->view->fetch();
	}
}